package com.itheima.tliasmanager.controller;

import com.itheima.tliasmanager.pojo.Dto.QueryParam;
import com.itheima.tliasmanager.pojo.Vo.PageResult;
import com.itheima.tliasmanager.pojo.Vo.Result;
import com.itheima.tliasmanager.pojo.domain.OperateLog;
import com.itheima.tliasmanager.service.LogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class LogComtroller {

    @Autowired
    private LogService logService;

    @GetMapping("/log/page")
    public Result page(QueryParam queryParam){
        log.info("C ------> 分页查询日志列表，参数：{}",queryParam);
        PageResult<OperateLog> pageResult = logService.page(queryParam);
        return Result.success(pageResult);
    }

}
